#include <mm/mmio.h>
#include <mm/mm.h>
#include <log.h>

#define LOG_TAG "mmio"

uptr ioremap(uptr pa, size_t count) {
    return mapping_pages(pa, count, PG_WRITE | PG_DISABLE_CACHE, VMAP_NON_RAM);
}

void iounmap(uptr va, size_t count) {
    for (uptr i = va; i < va + (count << 12); i += PG_SIZE) {
        free_page(unmapping_p2v(i));
    }
}